<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<div></div>
<script>
    if (window.testRunner)
        testRunner.dumpAsText();
    var host = document.querySelector('div');
    var root = host.attachShadow({mode: 'open'});
    root.innerHTML = '<style>:host(.enabled) #foo { background: green;}</style><div id="foo"></div>';
    
    var foo = root.querySelector("#foo");
    host.classList.add('enabled');
    shouldBe('getComputedStyle(foo).backgroundColor', '"rgb(0, 128, 0)"');
</script>